package com.wsm.common.enums;

/**
 * @name: DateEnum
 * @Author: wangshimin
 * @Date: 2020/2/4  18:52
 * @Description:
 */
public class DateEnum {
    //时间
    enum DateForm {

        Year("年", 5),
        Month("月", 4),
        Day("日", 3),
        Hour("时", 2),
        Minutes("分", 1),
        Seconds("秒", 0);

        private String name;

        private int value;

        DateForm(String name, int value) {
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getValue() {
            return value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public static DateForm getDate(String name) {
            for (DateForm e : DateForm.values()) {
                if (e.name().equals(name)) {
                    return e;
                }
            }
            return null;
        }
    }
}
